﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;

namespace HFWebApp
{
    public partial class _Default : HFController.BagePages
    {
        public List<hf.Model.News> rotationNewsList = new List<hf.Model.News>();
        public List<hf.Model.Ad> adList1 = new List<hf.Model.Ad>();
        public List<hf.Model.Ad> adList2 = new List<hf.Model.Ad>();
        public List<hf.Model.Ad> adList3 = new List<hf.Model.Ad>();
        public List<hf.Model.Ad> adList4 = new List<hf.Model.Ad>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            { 
                //绑定法律专题分类
                rpt_Topic.DataSource = NewsController.getController().getTopicList(30);
                rpt_Topic.DataBind();

                //首页法律咨询，置顶新闻绑定
                rpt_1.DataSource = NewsController.getController().getNewsList(1, 1, 1);
                rpt_1.DataBind();

                //首页法律咨询，首页新闻绑定
                rpt_2.DataSource = NewsController.getController().getNewsList(7, 1, 0);
                rpt_2.DataBind();

                //绑定推荐首页的律师
                rpt_lawyer.DataSource = LawyerController.getController().getLawyerList(6, 1);
                rpt_lawyer.DataBind();
                
                //得到轮播新闻列表
                rotationNewsList = NewsController.getController().getNewsList(5, 1);

                //置顶有图片标题的一条
                rpt_isTopArtice.DataSource = ArticleController.getController().getArticleList(1, 1, 1);
                rpt_isTopArtice.DataBind();

                //文章列表，推荐
                rpt_ArticleList.DataSource = ArticleController.getController().getArticleList(6, 0, 1);
                rpt_ArticleList.DataBind();

                /*
                //文字连接
                txtLink_Rpt.DataSource = AdController.getController().getAdList(23, 0, 1);
                txtLink_Rpt.DataBind();

                //图片连接
                picLink_Rpt.DataSource = AdController.getController().getAdList(6, 1, 1);
                picLink_Rpt.DataBind();
                 * */

                //通栏广告4
                adList4 = AdController.getController().getAdList(4, 1, 7);
                //通栏广告3
                adList3 = AdController.getController().getAdList(4 ,1 ,6);
                //通栏广告2
                adList2 = AdController.getController().getAdList(4, 1, 5);
                //通栏广告1
                adList1 = AdController.getController().getAdList(4, 1, 3);
                //地区找律师下方
                picad_Rpt.DataSource = AdController.getController().getAdList(1, 1, 4);
                picad_Rpt.DataBind();
                //法治咨询下方
                picad2_Rpt.DataSource = AdController.getController().getAdList(1, 1, 2);
                picad2_Rpt.DataBind();
            }
        }
    }
}